﻿using BLToolkit.Data.Linq;
using SettlersAuto.Data;
using SettlersAuto.Data.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace SettlersAuto.Web.Controllers
{
    public partial class EntryPointController : Controller
    {
        private static readonly int MinimumSlotsPerSession = 10;

        //
        // GET: /EntryPoint/

        public virtual ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public void UploadServerResponse(int length, string data)
        {
            var bytes = Convert.FromBase64String(data);

            if (bytes.Length != length)
            {
                throw new ArgumentException("Invalid lenght.");
            }

            DataImport.ProcessServerResponse(bytes);
        }
    }
}
